/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package AIReservation;

/**
 *
 * @author micheal
 */

class Pattern
{

    Pattern(int i, String s)
    {
        weight = i;
        length = s.length();
        offset = 0;
        v = 0;
        int j = 1;
        for(int k = 0; k < length; k++)
        {
            switch(s.charAt(k))
            {
            case 120: // 'x'
                v += 2 * j;
                break;

            case 42: // '*'
                v += j;
                offset = k;
                break;

            case 45: // '-'
                v += j;
                break;
            }
            j *= 3;
        }

    }

    int weight;
    int length;
    int offset;
    int v;
}